:root {
  --primary-color: #ec4141; /* 网易云红 */
  --secondary-color: #f86442;
  --dark-bg: #2e2e2e;
  --light-bg: #f8f8f8;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #e1e1e1;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.player-container {
  background-color: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.player-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  z-index: -1;
  border-radius: 16px 16px 0 0;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  color: white;
}

.player-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.control-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.control-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.play-btn {
  font-size: 30px;
  width: 50px;
  height: 50px;
  background-color: white;
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.player-cover {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  margin: 0 auto 30px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: rotate 20s linear infinite;
  animation-play-state: paused;
  border: 5px solid white;
  position: relative;
  transition: var(--transition);
}

.player-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    transparent 60%,
    rgba(0, 0, 0, 0.1) 100%
  );
  border-radius: 50%;
}

.player-cover.playing {
  animation-play-state: running;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.player-info {
  text-align: center;
  margin-bottom: 30px;
}

.song-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: inline-block;
}

.song-artist {
  font-size: 16px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.progress-container {
  margin: 30px 0;
}

.progress-bar {
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0.2;
}

.progress {
  height: 100%;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 3px;
  position: relative;
  transition: width 0.1s linear;
}

.progress::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.progress-bar:hover .progress::after {
  opacity: 1;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.playlist {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.playlist-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.playlist-count {
  color: var(--text-light);
  font-size: 14px;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
}

.playlist-items {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.1);
}

.playlist-items::-webkit-scrollbar {
  width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 3px;
}

.playlist-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 5px;
}

.playlist-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
  transform: translateX(5px);
}

.playlist-item.active {
  background-color: rgba(236, 65, 65, 0.1);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.playlist-item.active .playlist-item-artist,
.playlist-item.active .playlist-item-duration {
  color: var(--primary-color);
  opacity: 0.8;
}

.playlist-item-index {
  width: 30px;
  text-align: center;
  color: var(--text-light);
  font-weight: 500;
  font-size: 15px;
}

.playlist-item.active .playlist-item-index {
  color: var(--primary-color);
}

.playlist-item-info {
  flex: 1;
  min-width: 0;
}

.playlist-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-artist {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-duration {
  color: var(--text-light);
  font-size: 14px;
  margin-left: 10px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.volume-bar {
  width: 100px;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.volume-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0.2;
}

.volume-progress {
  height: 100%;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .player-container {
    padding: 20px;
  }

  .player-cover {
    width: 180px;
    height: 180px;
  }

  .player-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .player-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* 加载动画 */
@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}
